package com.freedom.sql.jdbc.request;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowDatabasesStatement;
import com.freedom.sql.jdbc.netty.MyNioSocketChannel;
import com.freedom.sql.jdbc.response.DatabasePacket;

public class ShowDatabasesPacket {
	@SuppressWarnings("unused")
	private static final Logger logger = LogManager.getLogger(ShowDatabasesPacket.class);
	private MyNioSocketChannel channel;
	private MySqlShowDatabasesStatement statement;
	private int packetSeq;

	public ShowDatabasesPacket(int _packetSeq, MyNioSocketChannel _channel, MySqlShowDatabasesStatement _statement) {
		packetSeq = _packetSeq;
		channel = _channel;
		statement = _statement;
	}

	public void read() throws Exception {
		// 开始处理,发送数据库给client
		new DatabasePacket(packetSeq,channel,statement).write();
	}
}
